<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>BrainTrain: header/UtilFunctions.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">BrainTrain
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_util_functions_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">UtilFunctions.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_util_functions_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;osg/Camera&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;osg/Geometry&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;osg/MatrixTransform&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;osg/Texture2D&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;osgViewer/Viewer&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;osg/PositionAttitudeTransform&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;osgText/Text&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;osgDB/ReadFile&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;osg/Shader&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;osg/Material&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;osgParticle/ParticleSystem&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="_util_functions_8h.html#a525335710b53cb064ca56b936120431e">   14</a></span>&#160;<span class="preprocessor">#define _USE_MATH_DEFINES</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span> </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">namespace </span>brtr {</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="namespacebrtr.html#af79a815819e2ef65ea9cd43dc9d43679">   27</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacebrtr.html#af79a815819e2ef65ea9cd43dc9d43679">collisionMask</a> = 0x1;      </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="namespacebrtr.html#a2060f4d70c0e3bc7e2e35f82e279a40d">   28</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacebrtr.html#a2060f4d70c0e3bc7e2e35f82e279a40d">interactionMask</a> = 0x2;</div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="namespacebrtr.html#a21ab851f18c0c85fa006766034833a4f">   29</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacebrtr.html#a21ab851f18c0c85fa006766034833a4f">interactionAndCollisionMask</a> = <a class="code" href="namespacebrtr.html#af79a815819e2ef65ea9cd43dc9d43679">collisionMask</a> | <a class="code" href="namespacebrtr.html#a2060f4d70c0e3bc7e2e35f82e279a40d">interactionMask</a>;</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="namespacebrtr.html#a5a7668dd62a6cbf00234c926a109fbef">   30</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacebrtr.html#a5a7668dd62a6cbf00234c926a109fbef">fakeWallMask</a> = 0x4;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structbrtr_1_1_body_of_rotation_function.html">   40</a></span>&#160;    <span class="keyword">struct  </span><a class="code" href="structbrtr_1_1_body_of_rotation_function.html">BodyOfRotationFunction</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structbrtr_1_1_body_of_rotation_function.html#a5fda598eb0a63696b059e3a27c01142b">   41</a></span>&#160;        std::function&lt;double(double)&gt; <a class="code" href="structbrtr_1_1_body_of_rotation_function.html#a5fda598eb0a63696b059e3a27c01142b">func</a>;     </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="structbrtr_1_1_body_of_rotation_function.html#a46667ab72bfeddc305bf31fa359c8699">   42</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="structbrtr_1_1_body_of_rotation_function.html#a46667ab72bfeddc305bf31fa359c8699">end</a>;                                 </div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structbrtr_1_1_body_of_rotation_function.html#ad7df29eaeb2504928488691196cc06eb">   43</a></span>&#160;        <span class="keyword">const</span> <a class="code" href="structbrtr_1_1_body_of_rotation_function.html">BodyOfRotationFunction</a>* <a class="code" href="structbrtr_1_1_body_of_rotation_function.html#ad7df29eaeb2504928488691196cc06eb">nextFunc</a>; </div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structbrtr_1_1_body_of_rotation_function.html#a22861c378686dabe1c35c90a0a8dcf46">   44</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="structbrtr_1_1_body_of_rotation_function.html#a22861c378686dabe1c35c90a0a8dcf46">derivation</a>(<span class="keywordtype">double</span> x)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            <span class="keywordtype">double</span> h = 1e-10; <span class="comment">//very small</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            <span class="keywordflow">return</span> (<a class="code" href="structbrtr_1_1_body_of_rotation_function.html#a5fda598eb0a63696b059e3a27c01142b">func</a>(x + h) - <a class="code" href="structbrtr_1_1_body_of_rotation_function.html#a5fda598eb0a63696b059e3a27c01142b">func</a>(x)) / h;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        };</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    };</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structbrtr_1_1_rendering_pipeline.html">   56</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structbrtr_1_1_rendering_pipeline.html">RenderingPipeline</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structbrtr_1_1_rendering_pipeline.html#ae945030321a6b44f00266954c8c50bf3">   57</a></span>&#160;        osg::ref_ptr&lt;osg::Camera&gt; <a class="code" href="structbrtr_1_1_rendering_pipeline.html#ae945030321a6b44f00266954c8c50bf3">pass_0_color</a>;             </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structbrtr_1_1_rendering_pipeline.html#a18752632c1b557d283e523ebbc0443a0">   58</a></span>&#160;        osg::ref_ptr&lt;osg::Camera&gt; <a class="code" href="structbrtr_1_1_rendering_pipeline.html#a18752632c1b557d283e523ebbc0443a0">pass_0_depth</a>;             </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structbrtr_1_1_rendering_pipeline.html#aea2228e41f1e5c6db5d616c05ecc27fd">   59</a></span>&#160;        osg::ref_ptr&lt;osg::Camera&gt; <a class="code" href="structbrtr_1_1_rendering_pipeline.html#aea2228e41f1e5c6db5d616c05ecc27fd">pass_PostProcess</a>;         </div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structbrtr_1_1_rendering_pipeline.html#afe773fb98986d39ef23a4edf3634af10">   60</a></span>&#160;        std::vector&lt;osg::ref_ptr&lt;osg::Program&gt;&gt; <a class="code" href="structbrtr_1_1_rendering_pipeline.html#afe773fb98986d39ef23a4edf3634af10">programs</a>;   </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    };</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="namespacebrtr.html#adcf0546a392221be3958ec96f99887f0">createRenderingPipeline</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height, osg::Node&amp; rootForToon, osgViewer::Viewer &amp;viewer, <a class="code" href="structbrtr_1_1_rendering_pipeline.html">RenderingPipeline</a>&amp; pipe, osg::Vec3f&amp; fogColor);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::LightSource&gt; <a class="code" href="namespacebrtr.html#ad772c6dbc0a2cabd40a284676c124a97">createLight</a>(<span class="keyword">const</span> osg::Vec3 &amp;pos, <span class="keywordtype">int</span> lightNum, <span class="keywordtype">int</span> point = 1, <span class="keywordtype">double</span> spotCutoff = 180, <span class="keywordtype">double</span> spotExponent = 0);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Camera&gt; <a class="code" href="namespacebrtr.html#aa7a89c381be095a7eb1e248d2e6c0e23">createRTTCamera</a>(osg::Camera::BufferComponent buffer, osg::Texture* tex, <span class="keywordtype">bool</span> isAbsolute = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geode&gt; <a class="code" href="namespacebrtr.html#a32cfc96621681baabc76c52af5d6a347">createScreenQuad</a>(<span class="keywordtype">float</span> width, <span class="keywordtype">float</span> height, <span class="keywordtype">float</span> scale = 1.0f);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Camera&gt; <a class="code" href="namespacebrtr.html#a62da4f109238c45882dd64d7a7e97a1d">createHUDCamera</a>(<span class="keywordtype">double</span> left, <span class="keywordtype">double</span> right, <span class="keywordtype">double</span> bottom, <span class="keywordtype">double</span> top);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osgText::Text&gt; <a class="code" href="namespacebrtr.html#a4431de1c1fa2c1d42c4fb57c38aaa3ce">createText</a>(<span class="keyword">const</span> osg::Vec3&amp; pos, <span class="keyword">const</span> std::string&amp; content, <span class="keywordtype">float</span> size);</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a83d3e627c9dc247459610aa9fec23d7b">createBodyOfRotation</a>(<span class="keywordtype">double</span> height, <span class="keywordtype">int</span> hsteps, <span class="keywordtype">int</span> rsteps, <span class="keyword">const</span> <a class="code" href="structbrtr_1_1_body_of_rotation_function.html">BodyOfRotationFunction</a>&amp; <span class="keyword">function</span>);</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a793c6ef7f57632fc5ac280b94f60dd65">createRectangle</a>(<span class="keywordtype">double</span> length, <span class="keywordtype">double</span> width, <span class="keywordtype">int</span> lsteps, <span class="keywordtype">int</span> wsteps);</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a4e91424e74398a612c38a920df0577ef">createRectangleWithTexcoords</a>(<span class="keywordtype">double</span> length, <span class="keywordtype">double</span> width, <span class="keywordtype">int</span> lsteps, <span class="keywordtype">int</span> wsteps);</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Group&gt; <a class="code" href="namespacebrtr.html#ae7f155c263aec9663a02763ed0bb882b">createCuboid</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> length, <span class="keyword">const</span> <span class="keywordtype">double</span> width, <span class="keyword">const</span> <span class="keywordtype">double</span> height, <span class="keyword">const</span> <span class="keywordtype">double</span> factor = 6);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    </div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::PositionAttitudeTransform&gt; <a class="code" href="namespacebrtr.html#a887d7975f37c4334b70e2196735b6678">wrapInPositionAttitudeTransform</a>(osg::Node * srcNode, <span class="keyword">const</span> osg::Vec3d&amp; pos);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a16fa8982307a039c08ab56912bab94b9">createBeerBottle</a>();</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a614d8d6b8bcc6c4e7f7ffb24ca48eb4c">createRealBottle</a>();</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#ab4f3c063f7a8fa6cc33a8cb52b036d27">createVase</a>();</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keyword">extern</span>  osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a4ccd9746e37278e47832da270dc00fb3">createStalk</a>();</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keyword">extern</span>  osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a51b3741c30ca1b6282b9693055ddc060">createBud</a>();</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geometry&gt; <a class="code" href="namespacebrtr.html#a118d4013732dea1a161b6d225df6dc2e">createChessFigure</a>();</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::PositionAttitudeTransform&gt; <a class="code" href="namespacebrtr.html#a05625aff9337331ae351d283f79f0f1e">createVaseWithFlower</a>();</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Geode&gt; <a class="code" href="namespacebrtr.html#a31c533ae635c528c761cc83e34e91b2f">createCrosshair</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Texture2D&gt; <a class="code" href="namespacebrtr.html#aea7b3b188858f0bce09f2450a749f497">createToonTex</a>(std::string toonTex);</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="keyword">extern</span> osg::ref_ptr&lt;osg::Material&gt; <a class="code" href="namespacebrtr.html#a7b54dcabf5846ea963221e59b38b0a79">createSimpleMaterial</a>(osg::Material::Face face, <span class="keyword">const</span> osg::Vec4&amp; diffuse, <span class="keyword">const</span> osg::Vec4&amp; ambient, <span class="keyword">const</span> osg::Vec4&amp; specular, <span class="keyword">const</span> <span class="keywordtype">double</span> shininess);</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    </div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    </div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="keyword">extern</span> osg::Vec3 <a class="code" href="namespacebrtr.html#a24ba7c5d07ad50afb09990116dd3556d">getDimensionOfNode</a>(osg::Node * source);</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;}</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div>
<div class="ttc" id="namespacebrtr_html_a24ba7c5d07ad50afb09990116dd3556d"><div class="ttname"><a href="namespacebrtr.html#a24ba7c5d07ad50afb09990116dd3556d">brtr::getDimensionOfNode</a></div><div class="ttdeci">osg::Vec3 getDimensionOfNode(osg::Node *source)</div><div class="ttdoc">return the dimension of a node (width, height, length) </div></div>
<div class="ttc" id="structbrtr_1_1_body_of_rotation_function_html_a22861c378686dabe1c35c90a0a8dcf46"><div class="ttname"><a href="structbrtr_1_1_body_of_rotation_function.html#a22861c378686dabe1c35c90a0a8dcf46">brtr::BodyOfRotationFunction::derivation</a></div><div class="ttdeci">double derivation(double x) const </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00044">UtilFunctions.h:44</a></div></div>
<div class="ttc" id="structbrtr_1_1_body_of_rotation_function_html"><div class="ttname"><a href="structbrtr_1_1_body_of_rotation_function.html">brtr::BodyOfRotationFunction</a></div><div class="ttdoc">struct holding the function, which calculates the radius in dependece of the height. lambda (double)->double func, int end, BodyOfRotationFunction* nextFunc if one wish to have more then one function then the end value and nextFunc pointer must be set accordingly the end+1 is the beginning x of the next function </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00040">UtilFunctions.h:40</a></div></div>
<div class="ttc" id="namespacebrtr_html_a614d8d6b8bcc6c4e7f7ffb24ca48eb4c"><div class="ttname"><a href="namespacebrtr.html#a614d8d6b8bcc6c4e7f7ffb24ca48eb4c">brtr::createRealBottle</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createRealBottle()</div><div class="ttdoc">Creates a Bottle with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00377">UtilFunctions.cpp:377</a></div></div>
<div class="ttc" id="namespacebrtr_html_a118d4013732dea1a161b6d225df6dc2e"><div class="ttname"><a href="namespacebrtr.html#a118d4013732dea1a161b6d225df6dc2e">brtr::createChessFigure</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createChessFigure()</div><div class="ttdoc">Creates a "ChessFigure" with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00500">UtilFunctions.cpp:500</a></div></div>
<div class="ttc" id="structbrtr_1_1_body_of_rotation_function_html_ad7df29eaeb2504928488691196cc06eb"><div class="ttname"><a href="structbrtr_1_1_body_of_rotation_function.html#ad7df29eaeb2504928488691196cc06eb">brtr::BodyOfRotationFunction::nextFunc</a></div><div class="ttdeci">const BodyOfRotationFunction * nextFunc</div><div class="ttdoc">if end is less then createBodyOfRotation::height, must point towards the next function which shall be...</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00043">UtilFunctions.h:43</a></div></div>
<div class="ttc" id="namespacebrtr_html_a2060f4d70c0e3bc7e2e35f82e279a40d"><div class="ttname"><a href="namespacebrtr.html#a2060f4d70c0e3bc7e2e35f82e279a40d">brtr::interactionMask</a></div><div class="ttdeci">const int interactionMask</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00028">UtilFunctions.h:28</a></div></div>
<div class="ttc" id="namespacebrtr_html_a4ccd9746e37278e47832da270dc00fb3"><div class="ttname"><a href="namespacebrtr.html#a4ccd9746e37278e47832da270dc00fb3">brtr::createStalk</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createStalk()</div><div class="ttdoc">Creates a stalk with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00451">UtilFunctions.cpp:451</a></div></div>
<div class="ttc" id="namespacebrtr_html_a21ab851f18c0c85fa006766034833a4f"><div class="ttname"><a href="namespacebrtr.html#a21ab851f18c0c85fa006766034833a4f">brtr::interactionAndCollisionMask</a></div><div class="ttdeci">const int interactionAndCollisionMask</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00029">UtilFunctions.h:29</a></div></div>
<div class="ttc" id="namespacebrtr_html_ab4f3c063f7a8fa6cc33a8cb52b036d27"><div class="ttname"><a href="namespacebrtr.html#ab4f3c063f7a8fa6cc33a8cb52b036d27">brtr::createVase</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createVase()</div><div class="ttdoc">Creates a vase with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00412">UtilFunctions.cpp:412</a></div></div>
<div class="ttc" id="namespacebrtr_html_a4e91424e74398a612c38a920df0577ef"><div class="ttname"><a href="namespacebrtr.html#a4e91424e74398a612c38a920df0577ef">brtr::createRectangleWithTexcoords</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createRectangleWithTexcoords(double length, double width, int lsteps, int wsteps)</div><div class="ttdoc">Creates a Rectangle with TRIANGLE_STRIPS. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00118">UtilFunctions.cpp:118</a></div></div>
<div class="ttc" id="namespacebrtr_html_aa7a89c381be095a7eb1e248d2e6c0e23"><div class="ttname"><a href="namespacebrtr.html#aa7a89c381be095a7eb1e248d2e6c0e23">brtr::createRTTCamera</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Camera &gt; createRTTCamera(osg::Camera::BufferComponent buffer, osg::Texture *tex, bool isAbsolute=false)</div><div class="ttdoc">creates a RTTCam </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00025">UtilFunctions.cpp:25</a></div></div>
<div class="ttc" id="namespacebrtr_html_a31c533ae635c528c761cc83e34e91b2f"><div class="ttname"><a href="namespacebrtr.html#a31c533ae635c528c761cc83e34e91b2f">brtr::createCrosshair</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geode &gt; createCrosshair(unsigned int width, unsigned int height)</div><div class="ttdoc">creates a crosshair in the middle of the screen </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00555">UtilFunctions.cpp:555</a></div></div>
<div class="ttc" id="namespacebrtr_html_a16fa8982307a039c08ab56912bab94b9"><div class="ttname"><a href="namespacebrtr.html#a16fa8982307a039c08ab56912bab94b9">brtr::createBeerBottle</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createBeerBottle()</div><div class="ttdoc">Creates a BeerBottle with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00352">UtilFunctions.cpp:352</a></div></div>
<div class="ttc" id="structbrtr_1_1_body_of_rotation_function_html_a46667ab72bfeddc305bf31fa359c8699"><div class="ttname"><a href="structbrtr_1_1_body_of_rotation_function.html#a46667ab72bfeddc305bf31fa359c8699">brtr::BodyOfRotationFunction::end</a></div><div class="ttdeci">double end</div><div class="ttdoc">the end value of the function, should be less or equal createBodyOfRotation::height ...</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00042">UtilFunctions.h:42</a></div></div>
<div class="ttc" id="namespacebrtr_html_a32cfc96621681baabc76c52af5d6a347"><div class="ttname"><a href="namespacebrtr.html#a32cfc96621681baabc76c52af5d6a347">brtr::createScreenQuad</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geode &gt; createScreenQuad(float width, float height, float scale=1.0f)</div><div class="ttdoc">creates a texture-ready screen quad for postprocessing </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00047">UtilFunctions.cpp:47</a></div></div>
<div class="ttc" id="structbrtr_1_1_rendering_pipeline_html"><div class="ttname"><a href="structbrtr_1_1_rendering_pipeline.html">brtr::RenderingPipeline</a></div><div class="ttdoc">struct holding the camera for the multi-rendering passes. Also holds the program vector for the post ...</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00056">UtilFunctions.h:56</a></div></div>
<div class="ttc" id="structbrtr_1_1_body_of_rotation_function_html_a5fda598eb0a63696b059e3a27c01142b"><div class="ttname"><a href="structbrtr_1_1_body_of_rotation_function.html#a5fda598eb0a63696b059e3a27c01142b">brtr::BodyOfRotationFunction::func</a></div><div class="ttdeci">std::function&lt; double(double)&gt; func</div><div class="ttdoc">the function </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00041">UtilFunctions.h:41</a></div></div>
<div class="ttc" id="namespacebrtr_html_af79a815819e2ef65ea9cd43dc9d43679"><div class="ttname"><a href="namespacebrtr.html#af79a815819e2ef65ea9cd43dc9d43679">brtr::collisionMask</a></div><div class="ttdeci">const int collisionMask</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00027">UtilFunctions.h:27</a></div></div>
<div class="ttc" id="namespacebrtr_html_adcf0546a392221be3958ec96f99887f0"><div class="ttname"><a href="namespacebrtr.html#adcf0546a392221be3958ec96f99887f0">brtr::createRenderingPipeline</a></div><div class="ttdeci">void createRenderingPipeline(unsigned int width, unsigned int height, osg::Node &amp;rootForToon, osgViewer::Viewer &amp;viewer, RenderingPipeline &amp;pipe, osg::Vec3f &amp;fogColor)</div><div class="ttdoc">creates the rendering pipeline </div></div>
<div class="ttc" id="structbrtr_1_1_rendering_pipeline_html_ae945030321a6b44f00266954c8c50bf3"><div class="ttname"><a href="structbrtr_1_1_rendering_pipeline.html#ae945030321a6b44f00266954c8c50bf3">brtr::RenderingPipeline::pass_0_color</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Camera &gt; pass_0_color</div><div class="ttdoc">Camera for the first pass, renders the ColorBuffer to Texture. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00057">UtilFunctions.h:57</a></div></div>
<div class="ttc" id="namespacebrtr_html_ae7f155c263aec9663a02763ed0bb882b"><div class="ttname"><a href="namespacebrtr.html#ae7f155c263aec9663a02763ed0bb882b">brtr::createCuboid</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Group &gt; createCuboid(const double length, const double width, const double height, const double factor=6)</div><div class="ttdoc">Creates a Cubiod with TRIANGLE_STRIPS using the createRectangle function. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00245">UtilFunctions.cpp:245</a></div></div>
<div class="ttc" id="namespacebrtr_html_a7b54dcabf5846ea963221e59b38b0a79"><div class="ttname"><a href="namespacebrtr.html#a7b54dcabf5846ea963221e59b38b0a79">brtr::createSimpleMaterial</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Material &gt; createSimpleMaterial(osg::Material::Face face, const osg::Vec4 &amp;diffuse, const osg::Vec4 &amp;ambient, const osg::Vec4 &amp;specular, const double shininess)</div><div class="ttdoc">creates a simple material </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00597">UtilFunctions.cpp:597</a></div></div>
<div class="ttc" id="namespacebrtr_html_a51b3741c30ca1b6282b9693055ddc060"><div class="ttname"><a href="namespacebrtr.html#a51b3741c30ca1b6282b9693055ddc060">brtr::createBud</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createBud()</div><div class="ttdoc">Creates a bud with Material with the help of the BodyOfRotationFunction. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00477">UtilFunctions.cpp:477</a></div></div>
<div class="ttc" id="structbrtr_1_1_rendering_pipeline_html_a18752632c1b557d283e523ebbc0443a0"><div class="ttname"><a href="structbrtr_1_1_rendering_pipeline.html#a18752632c1b557d283e523ebbc0443a0">brtr::RenderingPipeline::pass_0_depth</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Camera &gt; pass_0_depth</div><div class="ttdoc">Camera for the first pass, renders the DepthBuffer to Texture. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00058">UtilFunctions.h:58</a></div></div>
<div class="ttc" id="namespacebrtr_html_a4431de1c1fa2c1d42c4fb57c38aaa3ce"><div class="ttname"><a href="namespacebrtr.html#a4431de1c1fa2c1d42c4fb57c38aaa3ce">brtr::createText</a></div><div class="ttdeci">osg::ref_ptr&lt; osgText::Text &gt; createText(const osg::Vec3 &amp;pos, const std::string &amp;content, float size)</div><div class="ttdoc">creates a (arial) text object for use with a hud camera </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00210">UtilFunctions.cpp:210</a></div></div>
<div class="ttc" id="namespacebrtr_html_a887d7975f37c4334b70e2196735b6678"><div class="ttname"><a href="namespacebrtr.html#a887d7975f37c4334b70e2196735b6678">brtr::wrapInPositionAttitudeTransform</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::PositionAttitudeTransform &gt; wrapInPositionAttitudeTransform(osg::Node *srcNode, const osg::Vec3d &amp;pos)</div><div class="ttdoc">Return the given Node in a PositionAttitudeTransform with a given position. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00238">UtilFunctions.cpp:238</a></div></div>
<div class="ttc" id="namespacebrtr_html_a62da4f109238c45882dd64d7a7e97a1d"><div class="ttname"><a href="namespacebrtr.html#a62da4f109238c45882dd64d7a7e97a1d">brtr::createHUDCamera</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Camera &gt; createHUDCamera(double left, double right, double bottom, double top)</div><div class="ttdoc">creates a HUD-Cam with a 2D-orthogonal projection matrix </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00061">UtilFunctions.cpp:61</a></div></div>
<div class="ttc" id="namespacebrtr_html_a5a7668dd62a6cbf00234c926a109fbef"><div class="ttname"><a href="namespacebrtr.html#a5a7668dd62a6cbf00234c926a109fbef">brtr::fakeWallMask</a></div><div class="ttdeci">const int fakeWallMask</div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00030">UtilFunctions.h:30</a></div></div>
<div class="ttc" id="namespacebrtr_html_a83d3e627c9dc247459610aa9fec23d7b"><div class="ttname"><a href="namespacebrtr.html#a83d3e627c9dc247459610aa9fec23d7b">brtr::createBodyOfRotation</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createBodyOfRotation(double height, int hsteps, int rsteps, const BodyOfRotationFunction &amp;function)</div><div class="ttdoc">Creates a body of rotation. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00151">UtilFunctions.cpp:151</a></div></div>
<div class="ttc" id="namespacebrtr_html_ad772c6dbc0a2cabd40a284676c124a97"><div class="ttname"><a href="namespacebrtr.html#ad772c6dbc0a2cabd40a284676c124a97">brtr::createLight</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::LightSource &gt; createLight(const osg::Vec3 &amp;pos, int lightNum, int point=1, double spotCutoff=180, double spotExponent=0)</div><div class="ttdoc">creates a Light with a lightsource </div></div>
<div class="ttc" id="namespacebrtr_html_aea7b3b188858f0bce09f2450a749f497"><div class="ttname"><a href="namespacebrtr.html#aea7b3b188858f0bce09f2450a749f497">brtr::createToonTex</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Texture2D &gt; createToonTex(std::string toonTex)</div><div class="ttdoc">creates a Texture2D object with the given toonTex </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00614">UtilFunctions.cpp:614</a></div></div>
<div class="ttc" id="namespacebrtr_html_a05625aff9337331ae351d283f79f0f1e"><div class="ttname"><a href="namespacebrtr.html#a05625aff9337331ae351d283f79f0f1e">brtr::createVaseWithFlower</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::PositionAttitudeTransform &gt; createVaseWithFlower()</div><div class="ttdoc">combines the stalk, bud and vase in a postitionAttitudetransform </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00581">UtilFunctions.cpp:581</a></div></div>
<div class="ttc" id="namespacebrtr_html_a793c6ef7f57632fc5ac280b94f60dd65"><div class="ttname"><a href="namespacebrtr.html#a793c6ef7f57632fc5ac280b94f60dd65">brtr::createRectangle</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Geometry &gt; createRectangle(double length, double width, int lsteps, int wsteps)</div><div class="ttdoc">Creates a Rectangle with TRIANGLE_STRIPS. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8cpp_source.html#l00072">UtilFunctions.cpp:72</a></div></div>
<div class="ttc" id="structbrtr_1_1_rendering_pipeline_html_afe773fb98986d39ef23a4edf3634af10"><div class="ttname"><a href="structbrtr_1_1_rendering_pipeline.html#afe773fb98986d39ef23a4edf3634af10">brtr::RenderingPipeline::programs</a></div><div class="ttdeci">std::vector&lt; osg::ref_ptr&lt; osg::Program &gt; &gt; programs</div><div class="ttdoc">vector with the avaible postprocess programs </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00060">UtilFunctions.h:60</a></div></div>
<div class="ttc" id="structbrtr_1_1_rendering_pipeline_html_aea2228e41f1e5c6db5d616c05ecc27fd"><div class="ttname"><a href="structbrtr_1_1_rendering_pipeline.html#aea2228e41f1e5c6db5d616c05ecc27fd">brtr::RenderingPipeline::pass_PostProcess</a></div><div class="ttdeci">osg::ref_ptr&lt; osg::Camera &gt; pass_PostProcess</div><div class="ttdoc">PostProcess Camera, uses the texture from the first pass to create various effects. </div><div class="ttdef"><b>Definition:</b> <a href="_util_functions_8h_source.html#l00059">UtilFunctions.h:59</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_1ec98ce50fa6ec55b40b8ffb1df38c3c.html">header</a></li><li class="navelem"><a class="el" href="_util_functions_8h.html">UtilFunctions.h</a></li>
    <li class="footer">Generated on Thu Jul 17 2014 01:40:24 for BrainTrain by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
  </ul>
</div>
</body>
</html>
